﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ThietBiSo.LinQDB;
using ThietBiSo.Models;

namespace ThietBiSo.Controllers
{
    public class footerController : Controller
    {
        //
        // GET: /footer/

        MFooter mf = new MFooter();
        Footer f = new Footer();
        public ActionResult Index()
        {
            var v = mf.FindAll();
            ViewData["footers"] = v;
            return View();
        }
    
        [HttpPost]
        public ActionResult Index(FormCollection collection)
        {
            try
            {

                f.Id = 1;
                f.NoiDung = System.Net.WebUtility.HtmlDecode(collection.Get("ChiTiet"));
                mf.Update(f);
                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }

    }
}
